package com.kyivmohyla.kma2.dao.mapper;

import com.kyivmohyla.kma2.model.Refs;
import org.springframework.jdbc.core.ResultSetExtractor;

import java.sql.ResultSet;
import java.sql.SQLException;

class RefsResultSetExtractor implements ResultSetExtractor<Refs> {

    @Override
    public Refs extractData(ResultSet resultSet) throws SQLException {
        Refs refs = new Refs();
        try {
            refs.setServiceId(resultSet.getInt("service_id"));
            refs.setEquipmentId(resultSet.getInt("equipment_id"));
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return refs;
    }

}